package threading;

import java.util.Scanner;

public class Day12 {
    public static boolean fei(int a){
        if(a<2){
            return false;
        }
        for(int i = 2; i<=Math.sqrt(a);i++ ){
            if(a%i==0){
                return false;
            }
        }
        return true;
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = 0;
        int c = 0;
        int i;
        for(i =2;i <=a/2;i++){
            if(fei(i)&&fei(a-i)){
                b=i;
                c=a-i;
            }
        }
        System.out.println(b);
        System.out.println(c);
        return;
    }
}
